<h2>calendar.js</h2>
<p>Displays a calendar for date picking.</p>
<hr/>

<h3>Objects</h3>
<ul>
	<li><a href="#calendar">OAT.Calendar(optObj)</a></li>
</ul>

<h3>Methods</h3>
<ul>
	<li><a href="#show">OAT.Calendar::show(x, y, callback, [date])</a></li>
</ul>

<h3>CSS classes</h3>
<ul>
	<li>.calendar</li>
	<li>.calendar_selected</li>
	<li>.calendar_special</li>
	<li>.calendar_year</li>
	<li>.calendar_month</li>
</ul>

<hr/>

<h3><a name="calendar">OAT.Calendar(optObj)</a></h3>
<p>Instantiates the <em>OAT.Calendar</em> object. <em>optObj</em> may contain:</p>
<ul>
	<li>popup - bool; should clicking anywhere close the calendar? (default: <code>false</code>)</li>
</ul>

<h3><a name="show">OAT.Calendar::show(x, y, callback, [date])</a></h3>
<p>Shows the calendar. It will appear at [<em>x</em>, <em>y</em>]. If <em>date</em> is specified, 
it will be pre-selected. All dates are in form of [year, month, day], starting from 1. When user selects a date, a 
<em>callback</em>(date) will be called.</p>
<p>Further customizations can be done by setting some properties:</p>

<ul>
	<li>OAT.Calendar.dayNames - array of 7 day names</li>
	<li>OAT.Calendar.monthNames - array of 12 month names</li>
	<li>OAT.Calendar.specialDays - array specifying which days should be special (weekends)</li>
	<li>OAT.Calendar.weekStartIndex - index of day (in OAT.Calendar.dayNames) when week starts</li>
	<li>OAT.Calendar.dayZeroIndex - index of day for which <code>Date::getDay()</code> returns 0, i.e. Sunday.</li>
</ul>

<p class="code">
var c = new OAT.Calendar();<br/>
c.dayNames = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]; <br/>
c.monthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; <br/>
c.specialDays = [0,0,0,0,0,1,1]; <br/>
c.dayZeroIndex = 6; <br/>
c.weekStartIndex = 6; <br/>
c.show(100, 100, function(){});
</p>
